
/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7991624E-4703-4ACE-96FF-D7EB1401161E"}
 */
function onShow(firstShow, event) {
	controller.readOnly = true
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"6C4F27A6-4A2C-4B23-A59C-0B8257BEF451"}
 */
function onRecordSelection(event) {
	if (traslados_to_mnemotec != null)
		traslados_to_trasladodh.newRecord()	
	{
		var $rel = trasladodh_to_traslados.traslados_to_mnemotec.mnemotec_to_tarifari
		var $transfer = new Array()
		
		globals.gHotelSeleccionado = trasladodh_to_traslados.traslados_to_mnemotec.mnemotec_to_tarifari.tari_hote
		
		for (var i = 1 ; i <= $rel.getSize() ; i++)
		{
			var $reg = $rel.getRecord(i)
			var $desde = $reg.tari_desde
			if ($transfer.indexOf($desde,0) == -1)
				$transfer.push($desde)
		}
		application.setValueListItems('desde',$transfer)
	}
}

/**
 * Handle changed data.
 *
 * @param {String} oldValue old value
 * @param {String} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"84B9704C-88C5-45E1-8334-ADA9476A90DA"}
 */
function onDataChangeMedioTras(oldValue, newValue, event) {
	var $rel = trasladodh_to_tarifari_mediotr
	var $idavuelta = new Array()
	var $reales = new Array()

	for (var i = 1 ; i <= $rel.getSize() ; i++)
	{
		var $reg = $rel.getRecord(i)
		
		if ($reales.indexOf($reg.tari_idavuel,0) == -1)
		{
			var $valor = application.getValueListDisplayValue('tipo_trf',$reg.tari_idavuel)
			$idavuelta.push($valor)
			$reales.push($reg.tari_idavuel)
		}
	}
	application.setValueListItems('reserva_trf_idavuel',$idavuelta,$reales)
	return true
}
